#include "hdf.h"
#include "l12_parms.h"
#include "passthebuck.h"
#include "filehandle.h"


#define  SHORTNAME   128


typedef char   stname[SHORTNAME];
typedef char   prname[PRODSTRLEN];



typedef struct msval_struct {

    int32  l2sensorID;
    int32  l3sensorID;
    int32  nl2bands;
    int32_t   *l2Lambda;
    prname *l2prods;
    int    nl2prods;
    int32  nl3bands;
    int32_t   *l3Lambda;
    prname *l3prods;
    int    nl3prods;   
    char   *input_parms;
    int32_t   nfiles;
    int32_t   npixs;
    unsigned char   *data;
    stname   *filenames;
    int16    *fileID;
    int16    *year;
    int16    *day;
    int32    *msec;
    float32  *lon;
    float32  *lat;
    int16    *nscenes;
    int16    *nobs;
    int16    *iscan;
    float32  *data_vic;    
    int32    *l2_flags;
    uint8    *mside;
    uint8    *detnum;
    int16    *pixnum;
    float32  *data_val;

} msvalstr;


typedef struct valinput_struct {

    char   il2files [MAX_IFILES][FILENAME_MAX];
    char   il3file  [FILENAME_MAX];
    char   ofile    [FILENAME_MAX];
    prname l2prods[200];
    int    nl2prods;
    prname l3prods[200];
    int    nl3prods;
    char   input_parms[20000];
    char   l2flaguse  [1024];
    char   l3flaguse  [1024];
    int    deepwater;
    int    bpass_corr;
    int    subsmpl;
    int32_t   evalmask;

} inputstr;



int  msval_append(char *valfile, msvalstr valstr);
int32_t alloc_valstr(int32_t nfiles, int32_t npixs, msvalstr *valstr);
void free_valstr(msvalstr valstr, int all);
